﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace WindowsUserControl.UIUpdateWrapper
{
    /// <summary>
    /// 
    /// </summary>
    public class LabelUpdator
    {
        private Label _Label;
        private string _Text;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="lbl"></param>
        /// <param name="txt"></param>
        public LabelUpdator(Label lbl, string txt)
        {
            this._Label = lbl;
            this._Text = txt;
            this._Label.Invoke(new MethodInvoker(this.UpdateLabel));
        }

        private void UpdateLabel()
        {
            this._Label.Text = this._Text;
        }
    }
}
